]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
date-menu: Adjust boxpointer position for RTL locales
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 18 Feb 2011 23:09:01 +0000 (00:09 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 19 Feb 2011 10:19:19 +0000 (11:19 +0100)
We try to position the boxpointer centered above the calendar,
which swaps position with the events list when using a RTL locale,
so make the menu alignment dependent on the text direction.

https://bugzilla.gnome.org/show_bug.cgi?id=642721

js/ui/dateMenu.js

index dc2be15fe7ec51a32c3fc1ec57cf3d543278e730..9f6fb27d79bb5fbf2f9d37e38d0370cb7bfee87b 100644 (file)
@@ -56,7 +56,10 @@ DateMenuButton.prototype = {
         //this._eventSource = new Calendar.FakeEventSource();
         this._eventSource = new Calendar.EvolutionEventSource();
 
-        PanelMenu.Button.prototype._init.call(this, 0.25);
+        let menuAlignment = 0.25;
+        if (St.Widget.get_default_direction() == St.TextDirection.RTL)
+            menuAlignment = 1.0 - menuAlignment;
+        PanelMenu.Button.prototype._init.call(this, menuAlignment);
 
         this._clock = new St.Label();
         this.actor.set_child(this._clock);